<?php /* Smarty version Smarty-3.1.18, created on 2020-05-12 15:18:31
         compiled from "/data/www/mystery/protected/modules/webadmin/views/group/add.tpl" */ ?>
<?php /*%%SmartyHeaderCode:162458673954cf558d1dc523-86577790%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '096fd480fa2274e039e23fca74ba581ff572663b' => 
    array (
      0 => '/data/www/mystery/protected/modules/webadmin/views/group/add.tpl',
      1 => 1494904920,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '162458673954cf558d1dc523-86577790',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_54cf558d267261_77866291',
  'variables' => 
  array (
    'op_name' => 0,
    'info' => 0,
    'auth' => 0,
    'val' => 0,
    'v' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_54cf558d267261_77866291')) {function content_54cf558d267261_77866291($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("../common/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<table width="100%" border="0" cellspacing="0">
 <tr>
       <td width="13%" valign="top">
           <?php echo $_smarty_tpl->getSubTemplate ("../common/left.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

       </td>
       <td width="87%" valign="top">

               <table width="100%" border="0" cellspacing="0">
                 <tr>
                       <td>
                            <div class="subnav">
                                <div class="content-menu ib-a blue line-x"> <a href="/webadmin/group/list"><em>用户组管理</em></a><span>|</span><a class="on" href="javascript:;"><em><?php echo $_smarty_tpl->tpl_vars['op_name']->value;?>
</em></a> </div>
                            </div>
                            <div class="pad_10">
                              <div class="table-list">
                                    <div class="common-form">
                                        <form name="myform" action="<?php if ($_smarty_tpl->tpl_vars['info']->value) {?>/webadmin/group/doedit<?php } else { ?>/webadmin/group/doadd<?php }?>" method="post" autocomplete="off" id="myform">
                                        <table width="100%" class="table_form contentWrap">
                                        <tbody>
                                        <tr>
                                        <td>群组名称</td> 
                                        <td><input type="text" name="group_name" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['group_name'];?>
" class="input-text" id="rolename"></td>
                                        </tr>
                                        <tr>
                                        <td>群组描述</td>
                                        <td><textarea name="group_describe" rows="2" cols="20" id="description" class="inputtext" style="height:100px;width:500px;"><?php echo $_smarty_tpl->tpl_vars['info']->value['group_describe'];?>
</textarea></td>
                                        </tr>
                                        <tr>
                                            <td>权限设置</td>
                                            <td>
                                                <input type="checkbox" id="button" name="selall" value="*" <?php if ($_smarty_tpl->tpl_vars['info']->value&&$_smarty_tpl->tpl_vars['info']->value['group_auth']=='*') {?>checked="checked"<?php }?> />所有权限
                                                <div id="checked">
                                                <table cellspacing="0" border="0" width="100%">
                                                    <tbody>
                                                    <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['auth']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
                                                    <tr>
                                                      <td bgcolor="#f9f9f9"><strong><?php echo $_smarty_tpl->tpl_vars['val']->value['name'];?>
</strong></td>
                                                    </tr>
                                                    <tr>
                                                      <td height="40">
                                                          <?php if ($_smarty_tpl->tpl_vars['val']->value['sub']) {?>
                                                          <?php  $_smarty_tpl->tpl_vars['v'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['v']->_loop = false;
 $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['val']->value['sub']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['v']->key => $_smarty_tpl->tpl_vars['v']->value) {
$_smarty_tpl->tpl_vars['v']->_loop = true;
 $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['v']->key;
?>
                                                          <label><input type="checkbox" value="<?php echo $_smarty_tpl->tpl_vars['v']->value['action'];?>
" name="group_auth[]" class="auth_list" <?php if ($_smarty_tpl->tpl_vars['info']->value&&($_smarty_tpl->tpl_vars['info']->value['group_auth']=='*'||check_auth($_smarty_tpl->tpl_vars['v']->value['action'],$_smarty_tpl->tpl_vars['info']->value['group_auth']))) {?>checked="checked"<?php }?>><?php echo $_smarty_tpl->tpl_vars['v']->value['name'];?>
</label>
                                                          <?php } ?>
                                                            <?php }?>
                                                      </td>
                                                    </tr>
                                                    <?php } ?>
                                                  </tbody>
                                                </table>
                                                </div>
                                            </td>
                                        </tr>
                                        <tr>
                                        <td>是否启用</td>
                                        <td>
                                            <input type="radio" name="status" value="1" <?php if ($_smarty_tpl->tpl_vars['info']->value['status']==1) {?>checked="checked"<?php }?>> 启用  
                                            <label><input type="radio" name="status" <?php if ($_smarty_tpl->tpl_vars['info']->value['status']==0) {?>checked="checked"<?php }?> value="0">禁止</label></td>
                                        </tr>
                                        </tbody>
                                        </table>

                                        <div class="bk15"></div>
                                        <input name="group_id" value="<?php echo $_smarty_tpl->tpl_vars['info']->value['group_id'];?>
" type="hidden"/>
                                        <input name="dosubmit" type="submit" value="提交" class="button">
                                        </form>
                                        </div>
                              </div>
                            </div>

                       </td>
                 </tr>
               </table>
       </td>
 </tr>
</table>
<script type="text/javascript">
    (function($){
	$.fn.checkBox = function(state){
		this.each(function(){
			switch (state) {
				case 'all':
					$(this).prop("checked",'checked');
					break;
				case 'none':
					$(this).prop("checked",'');
					break;
				case 'toggle':
					$(this).prop("checked",!this.checked);
					break;
			}
		});
	};
	$.fn.checkedValue = function(){
		var str=[];
		this.each(function(){
			str+=$(this).val()+",";
		})
		return str;
	};
        $('.auth_list').click(function(){
            $('.auth_list').each(function(){
                if ($(this).prop('checked')==false){
                    $('#button').prop('checked', '');return false;
                }
            });
        });

})(jQuery);

$(document).ready(function(){
    $("#button").bind("click",function(){
        if ($(this).is(':checked')){
            $("#checked input[type=checkbox]").checkBox("all");
        } else {
            $("#checked input[type=checkbox]").checkBox("none");
        }

    });
    $('#myform').submit(function(){
        var rolename = $('#rolename').val();
        if (rolename == '') {
            $('#rolename').focus();alert('用户组名称不能为空！');return false;
        }
        if($('input[type=checkbox]:checked').length==0){
            alert('未选择任何权限');return false;
        }
        return true;
    });
});
</script>
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
